package org.glorylight.hacks.social.data;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component
@Scope("session")
public class UserProfile implements Serializable {

	private static final long serialVersionUID = -6517161699986486043L;
	private SessionIdentifier sessionIdentifier;
	private UserCredential userCredential;
	private String uid;
	private String name;
	private Map<String, MessageThread> threads = new HashMap<String, MessageThread>();
	private String babyName;
	private float babyAge;

	public UserProfile() {
	}

	public UserProfile(SessionIdentifier sessionIdentifier,
			UserCredential userCredential,
			String uid, String name) {
		this.sessionIdentifier = sessionIdentifier;
		this.userCredential = userCredential;
		this.uid = uid;
		this.name = name;
	}

	public SessionIdentifier getSessionIdentifier() {
		return sessionIdentifier;
	}

	public void setSessionIdentifier(SessionIdentifier sessionIdentifier) {
		this.sessionIdentifier = sessionIdentifier;
	}

	public UserCredential getUserCredential() {
		return userCredential;
	}

	public void setUserCredential(UserCredential userCredential) {
		this.userCredential = userCredential;
	}

	public String getUid() {
		return uid;
	}

	public void setUid(String uid) {
		this.uid = uid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public void addThreadMessage(MessageThread data) {
		this.threads.put(data.getId(), data);
	}

	public void addAllThreadMessage(Map<String, MessageThread> data) {
		this.threads.putAll(data);
	}
	
	public void clearThreadMessage() {
		this.threads.clear();
	}
	
	public Map<String, MessageThread> getThreads() {
		return threads;
	}
	
	public MessageThread getThreadMessage(String key) {
		return this.threads.get(key);
	}

	public String getBabyName() {
		return babyName;
	}

	public void setBabyName(String babyName) {
		this.babyName = babyName;
	}

	public float getBabyAge() {
		return babyAge;
	}

	public void setBabyAge(float babyAge) {
		this.babyAge = babyAge;
	}
	
}
